<?php

namespace app\index\controller;


class Upload extends Ajax
{
    public function picture()
    {
        header('Access-Control-Allow-Origin:*');
        $file = request()->file('file');
        if (empty($file)) {
            return $this->json(0, [], '请选择文件');
        }
        $info = $file->move(ROOT_PATH."/public/upload/");
        return $this->json($info, HOME_HOST . "/upload/" . $info->getSaveName(), '成功');
    }
}

